
const { request } = require('./https.js');

module.exports = {
  // 查询指定商品
  getGoodsByIdApi: (data) => {
    let url = 'launch/selectProductsByPid'
    return request({ url, data })
  },
  // 下单接口信息
  placeOrderApi: (data) => {
    let url = 'unite/jsapiPay'
    return request({ url, data })
  },
  // 查询订单状态(微信商户端)
  queryWxOrderInfoApi: () => {
    let url = 'unite/queryOrder'
    return request({ url, data })
  },
  // 统一生成订单
  createOrdersApi: (data) => {
    let url = 'unite/uniteCreateYpOrder'
    let method = 'POST';
    return request({ url, method, data })
  },
  // 统一查询订单结果
  getOrderResultApi: (data) => {
    let url = `unite/selectResultByoid?oid=${data.oid}`
    let method = 'POST';
    return request({ url, method })
  },
  // 根据订单号查询订单信息
  getOrderInfoBySuboidApi: (data) => {
    let url = 'app/orders/selectListByOid'
    return request({ url, data })
  },
  // 获取免费次数信息
  getFreeInfoApi: (data) => {
    let url = 'freeTimes/selectFreeTimesByPhone'
    return request({ url, data })
  },
  // 获取二维码(即商城指定类型商品)
  getMallListApi: (data) => {
    let url = 'mallProduct/list'
    return request({ url, data })
  },
  // 手机邮件保存发送
  sendPhoneEmailApi: (data) => {
    let url = 'launch/sendMail'
    return request({ url, data })
  },
  // 微信H5支付下单接口
  weixinH5PayApi: (data) => {
    let url = `unite/H5Pay?h5ScenceType=${data.h5ScenceType}&oid=${data.oid}`
    let method = 'POST';
    return request({ url, method })
  },

  // 微信H5支付下单接口
  weixiJsPayApi: (data) => {
    let url = `/unite/jsapiPay?h5ScenceType=${data.h5ScenceType}&oid=${data.oid}`
    let method = 'POST';
    return request({ url, method })
  },
  // 获取产品配置接口
  getProductConfigApi: (data) => {
    let url = 'advertise/selectProjectPosition'
    return request({ url, data })
  }
}